<%-- 
    Document   : ListRentalCar
    Created on : Nov 1, 2011, 11:59:00 PM
    Author     : Mr-aUgust
--%>

<%@page import="DAL.CarBookBean"%>
<%@page pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/taglib139.tld" prefix="pg" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <style type="text/css">
            #Table
            {
            border:1px solid green;
            }
            th
            {
             border:1px solid green;
            background-color:green;
            color:white;
            }
            .td
            {
             border:1px solid green;
            }
            .font
            {
                font-family:"Times New Roman", Times, serif;
                font-size:x-large;
                font-weight:bold;
                width:300px;
                margin-left:auto;
                margin-right:auto;
                color:#0707e7;
            }
        </style>
    </head>
    <body>
       <%
        session.removeAttribute("status");
        session.removeAttribute("statusH");
        
        CarBookBean cbb=new CarBookBean();
        Collection coll=cbb.AlllistOfCarRental();
        request.setAttribute("carb",coll);
    %>
       
    <div class="font">List Of All Cars Rental</div>    
    <table width="100%" id="Table">  
        <tr>
            <th>ID</th>
            <th>UserName</th>
            <th>CarID</th>
            <th>Pick Up Date</th>
            <th>Drop Off Date</th>
            <th>Time</th>
            <th>Total money</th>
            <th>Total Refund</th>
            <th>DateBook</th>
            <th width="10">Status Car Cancel</th>
            <th >Delete</th>
        </tr>
        <pg:paging pageSize="5" url="management.jsp?page=ListRenlatCar"  >
        <c:forEach items="${carb}" var="cr">
            <pg:item>
        <tr>
            <td class="td">${cr.bookingID}</td>
            <td class="td" width="60px">${cr.userName}</td>
            <td class="td">${cr.carID}</td>
            <td class="td">${cr.pickUpDate}</td>
            <td class="td">${cr.dropOffDate}</td>
            <td class="td">${cr.time}</td>
            <td class="td"><f:formatNumber value="${cr.totalMoney}" pattern="$#,###" /></td>
            <td class="td"><f:formatNumber value="${cr.totalRefund}" pattern="$#,###" /></td>
            <td class="td">${cr.dateBooking}</td>
            <td class="td">
                <c:if test="${cr.carCancel=='False'}">Yes</c:if>
                <c:if test="${cr.carCancel=='True'}">No</c:if>
            </td>            
            <td class="td" width="60px">
                <form action="../ControllerCarBook" method="post" name="delete">
                    <input type="hidden" name="bookingID" value="${cr.bookingID}" />
                    <input type="submit" name="delete1" value="Delete" OnClick="return confirm('Are you sure you want delete record this?');"/>
                </form>
            </td>
        </tr>
    </pg:item>       
    </c:forEach>
        <pg:index>
          <pg:page><%=thisPage%></pg:page>
        </pg:index>
    </pg:paging>
    </table>
    </body>
</html>

